﻿@using HuntingFishGame.ManageDomain.Model.GoldShopOrder;
@model GoldShopOrderModel
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="~/Content/mui.min.css" rel="stylesheet" />
    <script src="~/Scripts/mui.min.js"></script>
    <script src="~/Scripts/jQuery.min.js"></script>
    <title>支付平台</title>
    <script type="text/JavaScript">
        $(function () {
            var alipay = document.getElementById("alipay");
            alipay.addEventListener("tap", function () {
                var text = $("#text").html();
                var amount = $("#amount").html();
                var url = "@Url.Action("GetAlipayData", "Alipay")";
                $.post(url,
                    {
                        orderId:$("#orderId").val(),
                        text: text,
                        amount: amount,
                    }, function (data) {
                        if (data != "") {
                            $("#formDiv").append(data.alipayData);
                            $("#alipaysubmit").submit();
                        }
                    });
            });
            var wxpay = document.getElementById("wxpay");
            wxpay.addEventListener("tap", function () {
                window.location.href="/WeChat/OrderPayRequest?orderId="+$("#orderId").val()+"&toUrl='/GoldShopOrder/PaymentSuccess'&openid=@ViewBag.openid";
            });
        });
    </script>
</head>
<body>
    <div>
        <header class="mui-bar mui-bar-nav">
            <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
            <h1 class="mui-title">选择支付方式</h1>
        </header>
        <!--Infomations-->
        <div class="mui-content">
            <div class="mui-card">
                <input type="hidden" id="orderId" value="@Model.orderid" />
                <ul class="mui-table-view">
                    <li class="mui-table-view-cell">商品名称：<span id="text">@Model.text</span>
                    </li>
                    <li class="mui-table-view-cell">商品单价：<span id="amount">@Model.price</span>
                    </li>
                </ul>
            </div>
            <div style="color: red; margin: 10px; font-size: 14px;">订单有效时间：30分钟</div>
            <div class="mui-card">
                <ul class="mui-table-view">
                    <li id="alipay" class="mui-table-view-cell">
                        <a class="mui-navigate-right">支付宝
                        </a>
                    </li>
                    <li id="wxpay" class="mui-table-view-cell">
                        <a class="mui-navigate-right">微信
                        </a>
                    </li>
                </ul>
            </div>
        </div>
        <!--form-->
        <div id="formDiv" style="display: none;">
        </div>
    </div>
</body>
</html>
